<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php $this->load->view('include/html_head')?>
</head>
<body>
<div id="wrapper">
	<?php $this->load->view('include/header')?>
	<?php $this->load->view('include/menu')?>
	<div id="page">
		<div id="content">
		<?php $this->load->view('include/sub_navi')?>
			<div class="post">
			<form action='<?php echo BACKEND_ASSOCIATION_UPDATE_INFO_POST_PATH ?>' method=post id='update_info_form'>
				<p class="meta">个人信息修改</p>
				<div class="entry">
				<ul>
					<fieldset>
					<legend>社联成员基本信息</legend>
					<li>
						
						<label>姓名:</label>
						<input type='text' id='a_name' name='a_name' class="validate[required,minSize[2],maxSize[4],custom[onlyChinese]] text-input"  value='<?php echo set_value("a_name", $association['a_name']);?>' />
						<?php echo form_error('a_name', '<div class="error">', '</div>'); ?>
					</li>
					
					<li>
						<div id="radio">
							
							<?php
							$v1 = $v2 = '';
							if ($association['a_gender'] == 1) {
					        	$v1 = TRUE;
							} elseif ($association['a_gender'] == 2) {
								$v2 = TRUE;
							} ?>
							<label>性别:</label>
							<input type="radio" id="radio1" name="a_gender" class="validate[required] radio" value='1' <?php echo set_radio('a_gender', '1', $v1); ?>/><label for="radio1" style='font-size: 85%;'>男</label>
							<input type="radio" id="radio2" name="a_gender" class="validate[required] radio" value='2' <?php echo set_radio('a_gender', '2', $v2); ?>/><label for="radio2" style='font-size: 85%;'>女</label>
							<?php echo form_error('a_gender', '<div class="error">', '</div>'); ?>
						</div>
					</li>
					
					<li>
						
						<label>生日:</label>
						<?php $association['a_birth'] = $this->common->convert_birthday($association['a_birth']);?>
						<input type='text' id="datepicker" name='a_birth' class="validate[custom[date]] text-input" value='<?php echo set_value("a_birth", $association['a_birth']);?>' readonly/>
						<?php echo form_error('a_birth', '<div class="error">', '</div>'); ?>
					</li>
					
					<script>
					//给下拉菜单绑值
					$(function() {
						var association_array = getAllAssociationCategory();
						for (var i= 0; i < association_array.length; i++) {
							$('#a_category').append("<option value=" + (i + 1) + ">" + association_array[i] + "</option>");
						}
						$('#a_category option').each(function() {
							if($(this).val() == <?php echo $association['a_category'] + "" ?>) {
								$(this).attr("selected", "selected");
							}
						});
					});
					</script>
					<li>
						
						<label>部门:</label>
						<select name='a_category' id='a_category' class="validate[required]" >
							<option value="">请选择</option>
							<?php //echo form_error('a_category', '<div class="error">', '</div>'); ?>
						</select>
						<?php echo form_error('a_category', '<div class="error">', '</div>'); ?>
					</li>
					
					<li>
						
						<label>学号:</label>
						<input type='text' id='a_stu_num' name='a_stu_num' class="validate[required,minSize[8],maxSize[8],custom[integer],ajax[ajaxUpdateAssociationStudentNumber]] text-input" value='<?php echo set_value("a_stu_num", $association['a_stu_num']);?>'/>
						<?php echo form_error('a_stu_num', '<div class="error">', '</div>'); ?>
					</li>
					
					<script>
					//给下拉菜单绑值
					$(function() {
						var col_array = getAllCol();
						for (var i= 0; i < col_array.length; i++) {
							$('#a_col').append("<option value=" + col_array[i][0] + ">" + col_array[i][1] + "</option>");
						}
						$('#a_col option').each(function() {
							if($(this).val() == <?php echo $association['a_col'] + "" ?>) {
								$(this).attr("selected", "selected");
							}
						});
					});
					</script>
					<li>
						
						<label>学院:</label>
						<select name='a_col' id='a_col' class="validate[required]" onchange="f_change_col_pro(this,document.getElementById('a_pro'));">
							<option value="" selected="selected">请选择</option>
						</select>
						<?php echo form_error('a_col', '<div class="error">', '</div>'); ?>
					</li>
					
					<script>
					//给多级联动的下级下拉菜单绑值
					$(function() {
						var val = $('#a_col').val();
						var pro_array = getProByColId(val);
						for (var i= 0; i < pro_array.length; i++) {
							$('#a_pro').append("<option value=" + pro_array[i][0] + ">" + pro_array[i][1] + "</option>");
						}
						$('#a_pro option').each(function() {
							if($(this).val() == <?php echo $association['a_pro'] + "" ?>) {
								$(this).attr("selected", "selected");
							}
						});
					});
					</script>
					<li>
						
						<label>专业:</label>
						<select name='a_pro' id='a_pro' class="validate[required]" onchange="f_change_col_pro();">
							<option value="" selected="selected">请选择</option>
						</select>
						<?php echo form_error('a_pro', '<div class="error">', '</div>'); ?>
					</li>
					
					<li>
						
						<label>手机:</label>
						<input type='text' id='a_phone' name='a_phone' class="validate[required,custom[mobilenumber],ajax[ajaxUpdateAssociationPhone]] text-input" value='<?php echo set_value("a_phone", $association['a_phone']);?>'/>
						<?php echo form_error('a_phone', '<div class="error">', '</div>'); ?>
					</li>
					
					<li>
						
						<label>QQ:</label>
						<input type='text' id='a_qq' name='a_qq' class="validate[required,custom[qq],ajax[ajaxUpdateAssociationQQ]] text-input" value='<?php echo set_value("a_qq", $association['a_qq']);?>'/>
						<?php echo form_error('a_qq', '<div class="error">', '</div>'); ?>
					</li>
					</fieldset>
				 </ul>
				<input type="hidden" name='id' value='<?php echo $association['id']?>' />
				<button type='submit' >保存</button>&nbsp;
				<a class='anchor_button' onclick="history.back(-1);" >返回</a>
				</div>
			</form>
			</div>
			<div style="clear: both;">&nbsp;</div>
		</div>
		<!-- end #content -->
		<?php $this->load->view('include/side_bar')?>
		<div style="clear: both;">&nbsp;</div>
	</div>
	<!-- end #page -->
</div>
<?php $this->load->view('include/footer_content')?>
<?php $this->load->view('include/footer')?>
</body>
</html>
